import { bindActionCreators, Dispatch } from 'redux';
import { connect } from 'react-redux';
import Counter from '../components/Block';
import { saveCode } from '../store/actions/resources';
import { counterStateType } from '../store/reducers/types';


function mapStateToProps(state: counterStateType) {
  return {
    currentfile: state.currentfile
  };
}

function mapDispatchToProps(dispatch: Dispatch) {
  return bindActionCreators(
    {
      saveCode,
    },
    dispatch
  );
}

export default connect(mapStateToProps, mapDispatchToProps, null, { forwardRef: true })(Counter);